<template>
  <div id="login">
    <div class="login-container">
      <i class="avator"></i>
      <el-form
        class="login-form"
        label-width="80px"
        :model="loginInfornation"
        :rules="rules"
        ref="formLoginRef"
      >
        <el-form-item label="账号" prop="username">
          <el-input
            prefix-icon="el-icon-s-custom"
            v-model="loginInfornation.username"
          ></el-input>
        </el-form-item>
        <el-form-item label="密码" prop="password">
          <el-input
            prefix-icon="el-icon-lock"
            type="password"
            v-model="loginInfornation.password"
          ></el-input>
        </el-form-item>
        <div class="item-button">
          <el-button type="primary">登录</el-button>
          <el-button type="info">重置</el-button>
        </div>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      loginInfornation: {
        username: "zs",
        password: "123",
      },
      rules: {
        username: [
          { required: false, message: "请输入账号", trigger: "blur" },
          {
            min: 3,
            max: 5,
            message: "账号长度在 3 到 5 个字符",
            trigger: "blur",
          },
        ],
        password: [
          { required: false, message: "请输入密码", trigger: "blur" },
          {
            min: 6,
            max: 15,
            message: "密码长度在 6 到 15 个字符",
            trigger: "blur",
          },
        ],
      },
    };
  },
  methods: {
    reset(){
      this.$refs.formLoginRef.
    }
  },
};
</script>

<style scoped lang="scss">
#login {
  height: 100vh;
  background: #409eff;
}
.login-container {
  width: 700px;
  height: 400px;
  background: #fff;
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0 20px;
  .avator {
    display: inline-block;
    width: 150px;
    height: 150px;
    background: url("../../assets/img/xxy.jpg") no-repeat;
    background-size: 100% 100%;
    position: relative;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
  }
  .login-form {
    .item-button {
      text-align: center;
    }
  }
}
</style>